import memcache
import time

# host = '192.168.19.97:11311'
# host = '192.168.8.78:11212'
host = '127.0.0.1:11211'

# host = '127.0.0.1:11211'
# host = '39.107.52.5:11211'
# host = '106.15.124.226:11211'
# host = '182.92.134.49:11211'
conn = memcache.Client([host])
# print(conn.set('k1', 'v1 fuck', time=2, noreply=True, min_compress_len=13))
# conn.delete('k1')
begin = time.clock()
for i in range(10000):
    print('set kv')
    conn.set("key%d"%i, "value for key%d"%i, time=60)
print('time used:', time.clock() - begin)
#conn.append("k2", "append text2")
#print(conn.cas('k1', 'fuckd', time=0))
# print(conn.gets('k1'))
# print(conn.stats)
#print(conn.get_multi(['k1', 'k2']))

# conn.delete('k1')

